package com.hyy.nio.c2;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

public class Client {
    public static void main(String[] args) throws IOException {
        SocketChannel socketChannel = SocketChannel.open();
        socketChannel.connect(new InetSocketAddress("localhost",8080));
        socketChannel.write(Charset.defaultCharset().encode("123\n456465456444644646455456456\n1111\n"));
        socketChannel.write(Charset.defaultCharset().encode("12345646545644464\n"));
        System.in.read();
    }
}
